package com.lwl.controller.mht;

import com.lwl.entity.LayData;
import com.lwl.entity.mht.TMhtRecordDetail;
import com.lwl.service.mht.TMhtRecordDetailService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * (TMhtRecordDetail)表控制层
 *
 * @author Lei
 * @since 2022-10-29 10:53:11
 */
@RestController
@RequestMapping("tMhtRecordDetail")
public class TMhtRecordDetailController {
    /**
     * 服务对象
     */
    @Autowired
    private TMhtRecordDetailService tMhtRecordDetailService;

    /**
     *  将前端页面传过来的题目答案信息转化为Javabean的形式，然后存储到做题记录中
     * @return
     */
    // @RequestBody 把json字符串转化为对象，只能放在形参前面
    @PostMapping("insertDetail")
    public LayData insertDetail(@RequestBody List<TMhtRecordDetail> details){
        return new LayData(tMhtRecordDetailService.insertDetails(details));
    }

}
